<?php
require_once(ROOTDIR."/include/database/class.ReasonQueries.php");

$id = $_GET['id'];
$reason = $_GET['reason'];

// Convert |plus| to +
// Convert |amp| to &
$reason = str_replace("|amp|", "&", $reason);
$reason = str_replace("|plus|", "+", $reason);

$reasonQueries = new ReasonQueries();

$reasonQueries->updateBanReason($reason, $id);

// Convert & back to |amp| since & is an XML special character
$reason = str_replace("&", "|amp|", $reason);

// Send back the new active state
header('Content-Type: text/xml');
header("Cache-Control: no-cache, must-revalidate");
?>
<?echo "<?xml version=\"1.0\" ?>";?>
<root>
  <id><?=$id?></id>
	<reason><?=$reason?></reason>
</root>
